<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<spring:url value="/js/candidato/datigenerali.js" var="jsUrl"></spring:url>
<script src="${jsUrl}" type="text/javascript"></script>

<div class="unit-row">
	<div class="unit-70" style="width:100%;opacity:0.7;background-color:#FFFFFF;font-weight:bold;">
		<nav class="nav-tabs unit-centered" style="width:1000px">
			<ul>
				<li><span>Email Job</span></li>						
				<li><a href="<c:url value="j_spring_security_logout" />">Logout</a></li>
			</ul>
		</nav>
		<br/>
		<c:if test="${not empty datiAnagraficiSalvati}">
			<div class="message message-success">
	    		<span class="close"></span>
	    		Dati salvati con successo
			</div>
		</c:if>
		<c:if test="${not empty requestScope['org.springframework.validation.BindingResult.azienda'].allErrors}">
			<div class="message message-error">
			    <span class="close"></span>
			    Sono presenti degli errori!
			    <c:forEach items="${flowRequestContext.messageContext.allMessages}" var="message">
					<c:if test="${message.source eq 'presente'}">
					      Azienda gi&agrave; presente in archivio!
					</c:if>
 				 </c:forEach>
			</div>
		</c:if>
		<form:form id="emailJobForm" method="post" action="${flowExecutionUrl}"
			commandName="emailJobForm" cssClass="forms forms-columnar">
			
			<p class="forms-inline">
				<form:label path="pollingInterval" cssErrorClass="error">Tempo di polling <em class="req">*</em></form:label>
				<form:input path="pollingInterval" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="pollingInterval" cssClass="error"></form:errors>
			</p>
			<p class="forms-inline">
				<form:label path="messageWindow" cssErrorClass="error">Messaggi ds scaricare <em class="req">*</em></form:label>
				<form:input path="messageWindow" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="messageWindow" cssClass="error"></form:errors>
			</p>
			<p class="forms-inline">
				<form:label path="delay" cssErrorClass="error">Ritardo di avvio <em class="req">*</em></form:label>
				<form:input path="delay" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="delay" cssClass="error"></form:errors>
			</p>
			
			<p align="right">
				<c:if test="${not empty emailJobForm.pollingInterval}">
					<input type="hidden" name="_eventId" value="stopEmailJob" >
					<input type="submit" class="btn"  value="Ferma">
					<input type="button" class="btn" disabled="disabled" value="Schedula">
				</c:if>
				<c:if test="${empty emailJobForm.pollingInterval}">
					<input type="hidden" name="_eventId" value="scheduleEmailJob" >
					<input type="button" class="btn" disabled="disabled" value="Ferma">
					<input type="submit" class="btn" value="Schedula">
				</c:if>
			</p>
		</form:form>
	</div>
</div>

